<?php
/**
 * @package    Joomla.Tutorials
 */

// No direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

// Require the base controller

require_once( JPATH_COMPONENT.DS.'controller.php' );

// Require specific controller if requested
$controller = JRequest::getCmd('controller');
switch ($controller) {
	default:
		$controller = 'render';
	case 'slideshow':
	case 'news':
		require_once( JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php' );
		$controllerName = 'RendersController'.$controller;
		$controller = new $controllerName();
		$controller->execute( JRequest::getCmd('task') );
		$controller->redirect();
		break;
}
/*
if($controller) {

	$path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php';
	if (file_exists($path)) {
		require_once $path;
	} else {
		$controller = '';
	}
}

// Create the controller
$classname	= 'RendersController'.$controller;
$controller	= new $classname( );

// Perform the Request task
$controller->execute( JRequest::getVar( 'task' ) );

// Redirect if set by the controller
$controller->redirect();
 *
 */